<template>
  <div class="right-container">
    <h3>Right 组件 是否全选:{{isAll}}</h3>
    <hr />
 <p>count 值：{{ count }} {{name}}</p>
    <button @click="add({ num: -5 })" class="btn btn-warning">-1</button>
     <button @click="$store.dispatch('subAsync')" class="btn btn-warning">异步-1</button>
  </div>
</template>

<script>
import { mapState, mapMutations, mapGetters, mapActions } from "vuex";
export default {
  name: "Right",
  computed: {
    ...mapState(["count","name"]),
    // isAll(){
    //   return
    // }
    ...mapGetters(['isAll'])
  },
  methods: {
    ...mapMutations(["add",'sub']),
    ...mapActions(['subAsync'])
  },
};
</script>

<style>
</style>
